package us.proyecto.canarios.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "VOTACION")
public class Votacion {

	private int idvotacion;
	private Puntuacion puntuacion;
	private String valor;
	
	@Id
    @SequenceGenerator(name = "votacionId", sequenceName = "CAN_VOT_SEQ", initialValue = 1, allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "votacionId")
    @Column(name = "ID_VOTACION", nullable = false, precision = 8, scale = 0)
	public int getIdvotacion() {
		return idvotacion;
	}
	public void setIdvotacion(int idvotacion) {
		this.idvotacion = idvotacion;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "FK_PUNTUACION")
	public Puntuacion getPuntuacion() {
		return puntuacion;
	}
	public void setPuntuacion(Puntuacion puntuacion) {
		this.puntuacion = puntuacion;
	}
	@Column(name = "VALOR", length= 2)
	public String getValor() {
		return valor;
	}
	public void setValor(String valor) {
		this.valor = valor;
	}
	
	
}
